using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Raster._RasterDataset
{
    /// <summary>
    /// <para>Download Rasters</para>
    /// <para>Downloads the source  files from an image service or mosaic dataset.</para>
    /// <para>从影像服务或镶嵌数据集下载源文件。</para>
    /// </summary>    
    [DisplayName("Download Rasters")]
    public class DownloadRasters : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public DownloadRasters()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_image_service">
        /// <para>Input</para>
        /// <para>The image service or mosaic dataset to download.</para>
        /// <para>要下载的影像服务或镶嵌数据集。</para>
        /// </param>
        /// <param name="_out_folder">
        /// <para>Output Folder</para>
        /// <para>The destination for the image service or mosaic dataset.</para>
        /// <para>影像服务或镶嵌数据集的目标。</para>
        /// </param>
        public DownloadRasters(object _in_image_service, object _out_folder)
        {
            this._in_image_service = _in_image_service;
            this._out_folder = _out_folder;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Download Rasters";

        public override string CallName => "management.DownloadRasters";

        public override List<string> AcceptEnvironments => ["extent"];

        public override object[] ParameterInfo => [_in_image_service, _out_folder, _where_clause, _selection_feature, _clipping.GetGPValue(), _convert_rasters.GetGPValue(), _format.GetGPValue(), _compression_method.GetGPValue(), _compression_quality, _MAINTAIN_FOLDER.GetGPValue(), _derived_out_folder];

        /// <summary>
        /// <para>Input</para>
        /// <para>The image service or mosaic dataset to download.</para>
        /// <para>要下载的影像服务或镶嵌数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_image_service { get; set; }


        /// <summary>
        /// <para>Output Folder</para>
        /// <para>The destination for the image service or mosaic dataset.</para>
        /// <para>影像服务或镶嵌数据集的目标。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Folder")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_folder { get; set; }


        /// <summary>
        /// <para>Query Definition</para>
        /// <para>An SQL expression to limit the download to raster datasets that satisfy the expression.</para>
        /// <para>一个 SQL 表达式，用于将下载限制为满足表达式的栅格数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Query Definition")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _where_clause { get; set; } = null;


        /// <summary>
        /// <para>Selection Feature</para>
        /// <para><xdoc>
        ///   <para>Limits the download to an extent of a feature class or bounding box. All raster datasets that intersect the extent will be downloaded.</para>
        ///   <bulletList>
        ///     <bullet_item>Default—The extent will be based on the maximum extent of all participating inputs. This is the default.</bullet_item><para/>
        ///     <bullet_item>Current Display Extent—The extent is equal to the data frame or visible display. The option is not available when there is no active map.</bullet_item><para/>
        ///     <bullet_item>As Specified Below—The extent will be based on the minimum and maximum extent values specified.</bullet_item><para/>
        ///     <bullet_item>Browse—The extent will be based on an existing dataset.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将下载限制在要素类或边界框的范围内。将下载与范围相交的所有栅格数据集。</para>
        ///   <bulletList>
        ///     <bullet_item>默认值 - 范围将基于所有参与输入的最大范围。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>当前显示范围 - 范围等于数据框或可见显示。当没有活动地图时，该选项不可用。</bullet_item><para/>
        ///     <bullet_item>如下所述 - 范围将基于指定的最小和最大范围值。</bullet_item><para/>
        ///     <bullet_item>浏览 - 范围将基于现有数据集。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Selection Feature")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _selection_feature { get; set; } = null;


        /// <summary>
        /// <para>Clipping Using Selection Feature</para>
        /// <para><xdoc>
        ///   <para>Specify if you want to clip the downloaded images based on the geometry of a feature. Any raster that intersects the clipping geometry will be clipped and then downloaded. This is useful when your area of interest is not a rectangle. When downloaded images are clipped, you need to specify an output format for the clipped images.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—The files will be clipped based on the minimum bounding rectangle that has been specified. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—The files will be clipped based on the geometry of the Selection Feature.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否要根据要素的几何裁剪下载的图像。任何与剪裁几何相交的栅格都将被裁剪，然后下载。当您感兴趣的区域不是矩形时，这很有用。剪裁下载的图像时，需要为剪裁的图像指定输出格式。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 将根据已指定的最小边界矩形裁剪文件。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 （Checked） - 文件将根据“选择特征”（Selection Feature） 的几何进行裁剪。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Clipping Using Selection Feature")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _clipping_value _clipping { get; set; } = _clipping_value._false;

        public enum _clipping_value
        {
            /// <summary>
            /// <para>CLIPPING</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CLIPPING")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_CLIPPING</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_CLIPPING")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Convert Rasters</para>
        /// <para><xdoc>
        ///   <para>Choose whether to always convert your rasters to the specified format, or to only convert when it is necessary.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Do not convert the raster datasets to a new format.</bullet_item><para/>
        ///     <bullet_item>Checked—Convert the downloaded raster datasets into another format. If you used Selection Feature to limit the extent, then you need to specify a format in the Output Format parameter.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>选择是始终将栅格转换为指定格式，还是仅在必要时进行转换。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 不将栅格数据集转换为新格式。</bullet_item><para/>
        ///     <bullet_item>选中 - 将下载的栅格数据集转换为其他格式。如果使用“选择功能”来限制范围，则需要在“输出格式”参数中指定格式。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Convert Rasters")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _convert_rasters_value _convert_rasters { get; set; } = _convert_rasters_value._false;

        public enum _convert_rasters_value
        {
            /// <summary>
            /// <para>ALWAYS_CONVERT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ALWAYS_CONVERT")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>CONVERT_AS_REQUIRED</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CONVERT_AS_REQUIRED")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Output Format</para>
        /// <para><xdoc>
        ///   <para>Choose a output format for the downloaded raster datasets.</para>
        ///   <bulletList>
        ///     <bullet_item>Tiff—Tagged Image File Format. This is the default.</bullet_item><para/>
        ///     <bullet_item>Bil—Esri band interleaved by line.</bullet_item><para/>
        ///     <bullet_item>Bsq—Esri band sequential.</bullet_item><para/>
        ///     <bullet_item>Bip—Esri band interleaved by pixel.</bullet_item><para/>
        ///     <bullet_item>Bmp—Bitmap.</bullet_item><para/>
        ///     <bullet_item>ENVI Dat—ENVI DAT file.</bullet_item><para/>
        ///     <bullet_item>Imagine image—ERDAS IMAGINE.</bullet_item><para/>
        ///     <bullet_item>Jpeg—Joint Photographics Experts Group. If chosen, you can also specify the compression quality. The valid compression quality value ranges are from 0 to 100.</bullet_item><para/>
        ///     <bullet_item>Gif—Graphic interchange format.</bullet_item><para/>
        ///     <bullet_item>Jp2—JPEG 2000. If chosen, you can also specify the compression quality. The valid compression quality value ranges are from 0 to 100.</bullet_item><para/>
        ///     <bullet_item>Png—Portable Network Graphics.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>选择下载的栅格数据集的输出格式。</para>
        ///   <bulletList>
        ///     <bullet_item>tiff - 标记的图像文件格式。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>Bil - 按线交错的 Esri 波段。</bullet_item><para/>
        ///     <bullet_item>Bsq - Esri 波段顺序。</bullet_item><para/>
        ///     <bullet_item>Bip - 按像素交错的 Esri 波段。</bullet_item><para/>
        ///     <bullet_item>Bmp - 位图。</bullet_item><para/>
        ///     <bullet_item>ENVI Dat - ENVI DAT 文件。</bullet_item><para/>
        ///     <bullet_item>想象图像——ERDAS IMAGINE。</bullet_item><para/>
        ///     <bullet_item>Jpeg - 联合图像专家组。如果选择，您还可以指定压缩质量。有效的压缩质量值范围为 0 到 100。</bullet_item><para/>
        ///     <bullet_item>Gif - 图形交换格式。</bullet_item><para/>
        ///     <bullet_item>JP2 - JPEG 2000。如果选择，您还可以指定压缩质量。有效的压缩质量值范围为 0 到 100。</bullet_item><para/>
        ///     <bullet_item>Png - 可移植网络图形。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Format")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _format_value _format { get; set; } = _format_value._TIFF;

        public enum _format_value
        {
            /// <summary>
            /// <para>Tiff</para>
            /// <para>Tiff—Tagged Image File Format. This is the default.</para>
            /// <para>tiff - 标记的图像文件格式。这是默认设置。</para>
            /// </summary>
            [Description("Tiff")]
            [GPEnumValue("TIFF")]
            _TIFF,

            /// <summary>
            /// <para>Bil</para>
            /// <para>Bil—Esri band interleaved by line.</para>
            /// <para>Bil - 按线交错的 Esri 波段。</para>
            /// </summary>
            [Description("Bil")]
            [GPEnumValue("BIL")]
            _BIL,

            /// <summary>
            /// <para>Bsq</para>
            /// <para>Bsq—Esri band sequential.</para>
            /// <para>Bsq - Esri 波段顺序。</para>
            /// </summary>
            [Description("Bsq")]
            [GPEnumValue("BSQ")]
            _BSQ,

            /// <summary>
            /// <para>Bip</para>
            /// <para>Bip—Esri band interleaved by pixel.</para>
            /// <para>Bip - 按像素交错的 Esri 波段。</para>
            /// </summary>
            [Description("Bip")]
            [GPEnumValue("BIP")]
            _BIP,

            /// <summary>
            /// <para>Bmp</para>
            /// <para>Bmp—Bitmap.</para>
            /// <para>Bmp - 位图。</para>
            /// </summary>
            [Description("Bmp")]
            [GPEnumValue("BMP")]
            _BMP,

            /// <summary>
            /// <para>ENVI Dat</para>
            /// <para>ENVI Dat—ENVI DAT file.</para>
            /// <para>ENVI Dat - ENVI DAT 文件。</para>
            /// </summary>
            [Description("ENVI Dat")]
            [GPEnumValue("ENVI")]
            _ENVI,

            /// <summary>
            /// <para>Imagine image</para>
            /// <para>Imagine image—ERDAS IMAGINE.</para>
            /// <para>想象图像——ERDAS IMAGINE。</para>
            /// </summary>
            [Description("Imagine image")]
            [GPEnumValue("IMAGINE Image")]
            _IMAGINE_Image,

            /// <summary>
            /// <para>Jpeg</para>
            /// <para>Jpeg—Joint Photographics Experts Group. If chosen, you can also specify the compression quality. The valid compression quality value ranges are from 0 to 100.</para>
            /// <para>Jpeg - 联合图像专家组。如果选择，您还可以指定压缩质量。有效的压缩质量值范围为 0 到 100。</para>
            /// </summary>
            [Description("Jpeg")]
            [GPEnumValue("JPEG")]
            _JPEG,

            /// <summary>
            /// <para>Gif</para>
            /// <para>Gif—Graphic interchange format.</para>
            /// <para>Gif - 图形交换格式。</para>
            /// </summary>
            [Description("Gif")]
            [GPEnumValue("GIF")]
            _GIF,

            /// <summary>
            /// <para>Jp2</para>
            /// <para>Jp2—JPEG 2000. If chosen, you can also specify the compression quality. The valid compression quality value ranges are from 0 to 100.</para>
            /// <para>JP2 - JPEG 2000。如果选择，您还可以指定压缩质量。有效的压缩质量值范围为 0 到 100。</para>
            /// </summary>
            [Description("Jp2")]
            [GPEnumValue("JP2")]
            _JP2,

            /// <summary>
            /// <para>Png</para>
            /// <para>Png—Portable Network Graphics.</para>
            /// <para>Png - 可移植网络图形。</para>
            /// </summary>
            [Description("Png")]
            [GPEnumValue("PNG")]
            _PNG,

        }

        /// <summary>
        /// <para>Compression Method</para>
        /// <para><xdoc>
        ///   <para>Choose the compression method to use with the specified Output Format.</para>
        ///   <bulletList>
        ///     <bullet_item>None—No compression will occur. This is the default.</bullet_item><para/>
        ///     <bullet_item>Jpeg—Lossy compression that uses the public JPEG compression algorithm. If you choose JPEG, you can also specify the compression quality. The valid compression quality value ranges are from 0 to 100. This compression can be used for JPEG files and TIFF files.</bullet_item><para/>
        ///     <bullet_item>Lzw—Lossless compression that preserves all raster cell values.</bullet_item><para/>
        ///     <bullet_item>Packbits—PackBits compression for TIFF files.</bullet_item><para/>
        ///     <bullet_item>Rle—Run-length encoding for IMG files.</bullet_item><para/>
        ///     <bullet_item>Ccitt Group 3—Lossless compression for 1-bit data.</bullet_item><para/>
        ///     <bullet_item>Ccitt Group 4—Lossless compression for 1-bit data.</bullet_item><para/>
        ///     <bullet_item>Ccitt 1D—Lossless compression for 1-bit data.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>选择要用于指定输出格式的压缩方法。</para>
        ///   <bulletList>
        ///     <bullet_item>无—不会发生压缩。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>Jpeg - 使用公共 JPEG 压缩算法的有损压缩。如果选择 JPEG，还可以指定压缩质量。有效的压缩质量值范围为 0 到 100。此压缩可用于 JPEG 文件和 TIFF 文件。</bullet_item><para/>
        ///     <bullet_item>Lzw - 保留所有栅格像元值的无损压缩。</bullet_item><para/>
        ///     <bullet_item>Packbit - TIFF 文件的 PackBits 压缩。</bullet_item><para/>
        ///     <bullet_item>Rle - IMG 文件的运行长度编码。</bullet_item><para/>
        ///     <bullet_item>Ccitt Group 3 - 1 位数据的无损压缩。</bullet_item><para/>
        ///     <bullet_item>Ccitt Group 4 — 1 位数据的无损压缩。</bullet_item><para/>
        ///     <bullet_item>Ccitt 1D - 1 位数据的无损压缩。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Compression Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _compression_method_value _compression_method { get; set; } = _compression_method_value._NONE;

        public enum _compression_method_value
        {
            /// <summary>
            /// <para>None</para>
            /// <para>None—No compression will occur. This is the default.</para>
            /// <para>无—不会发生压缩。这是默认设置。</para>
            /// </summary>
            [Description("None")]
            [GPEnumValue("NONE")]
            _NONE,

            /// <summary>
            /// <para>Jpeg</para>
            /// <para>Jpeg—Lossy compression that uses the public JPEG compression algorithm. If you choose JPEG, you can also specify the compression quality. The valid compression quality value ranges are from 0 to 100. This compression can be used for JPEG files and TIFF files.</para>
            /// <para>Jpeg - 使用公共 JPEG 压缩算法的有损压缩。如果选择 JPEG，还可以指定压缩质量。有效的压缩质量值范围为 0 到 100。此压缩可用于 JPEG 文件和 TIFF 文件。</para>
            /// </summary>
            [Description("Jpeg")]
            [GPEnumValue("JPEG")]
            _JPEG,

            /// <summary>
            /// <para>Lzw</para>
            /// <para>Lzw—Lossless compression that preserves all raster cell values.</para>
            /// <para>Lzw - 保留所有栅格像元值的无损压缩。</para>
            /// </summary>
            [Description("Lzw")]
            [GPEnumValue("LZW")]
            _LZW,

            /// <summary>
            /// <para>Packbits</para>
            /// <para>Packbits—PackBits compression for TIFF files.</para>
            /// <para>Packbit - TIFF 文件的 PackBits 压缩。</para>
            /// </summary>
            [Description("Packbits")]
            [GPEnumValue("PACKBITS")]
            _PACKBITS,

            /// <summary>
            /// <para>Rle</para>
            /// <para>Rle—Run-length encoding for IMG files.</para>
            /// <para>Rle - IMG 文件的运行长度编码。</para>
            /// </summary>
            [Description("Rle")]
            [GPEnumValue("RLE")]
            _RLE,

            /// <summary>
            /// <para>Ccitt Group 3</para>
            /// <para>Ccitt Group 3—Lossless compression for 1-bit data.</para>
            /// <para>Ccitt Group 3 - 1 位数据的无损压缩。</para>
            /// </summary>
            [Description("Ccitt Group 3")]
            [GPEnumValue("CCITT_GROUP3")]
            _CCITT_GROUP3,

            /// <summary>
            /// <para>Ccitt Group 4</para>
            /// <para>Ccitt Group 4—Lossless compression for 1-bit data.</para>
            /// <para>Ccitt Group 4 — 1 位数据的无损压缩。</para>
            /// </summary>
            [Description("Ccitt Group 4")]
            [GPEnumValue("CCITT_GROUP4")]
            _CCITT_GROUP4,

            /// <summary>
            /// <para>Ccitt 1D</para>
            /// <para>Ccitt 1D—Lossless compression for 1-bit data.</para>
            /// <para>Ccitt 1D - 1 位数据的无损压缩。</para>
            /// </summary>
            [Description("Ccitt 1D")]
            [GPEnumValue("CCITT_1D")]
            _CCITT_1D,

        }

        /// <summary>
        /// <para>Compression Quality</para>
        /// <para>Set a value from 1 - 100. Higher values will have better image quality, but less compression.</para>
        /// <para>设置一个介于 1 - 100 之间的值。值越高，图像质量越好，但压缩率越低。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Compression Quality")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _compression_quality { get; set; } = null;


        /// <summary>
        /// <para>Maintain Folder Structure</para>
        /// <para><xdoc>
        ///   <para>Determines the folder structure of the downloaded rasters.</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>Checked—replicates the hierarchical folder structure used to store the source raster datasets.</bullet_item><para/>
        ///       <bullet_item>Unchecked—raster datasets will be downloaded into the output folder as a flat folder structure</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>确定下载栅格的文件夹结构。</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>选中 - 复制用于存储源栅格数据集的分层文件夹结构。</bullet_item><para/>
        ///       <bullet_item>未选中—栅格数据集将作为平面文件夹结构下载到输出文件夹中</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maintain Folder Structure")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _MAINTAIN_FOLDER_value _MAINTAIN_FOLDER { get; set; } = _MAINTAIN_FOLDER_value._false;

        public enum _MAINTAIN_FOLDER_value
        {
            /// <summary>
            /// <para>MAINTAIN_FOLDER</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("MAINTAIN_FOLDER")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_MAINTAIN_FOLDER</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_MAINTAIN_FOLDER")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Updated Folder</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Folder")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _derived_out_folder { get; set; }


        public DownloadRasters SetEnv(object extent = null)
        {
            base.SetEnv(extent: extent);
            return this;
        }

    }

}